﻿using System;

namespace Surface
{
    public class Surface : IComparable<Surface>
    {
        public double Length { get; set; }
        public double Width { get; set; }

        public Surface(double length, double width)
        {
            this.Length = length;
            this.Width = width;
        }

        public double Size
        {
            get
            {
                return Length * Width;
            }
        }

        public int CompareTo(Surface surface)
        {
            if (this.Size < surface.Size)
            {
                return -1;
            }

            if (this.Size == surface.Size)
            {
                return 0;
            }

            return 1;
        }
    }
}
